const mongoose = require("mongoose");
const adminModel = require("./adminModel")
const commodityModel = require("./commodityModel")
const serviceModel = require("./serviceModel")
const shopDoorsSchma = new mongoose.Schema({
    name: String, //名称
    phone: String, // 电话
    time: String,    // 营业时间
    address: String, // 地址
    score: String,   // 评分
    describe: String, // 门店描述
    adminId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: adminModel
    },//所属门店管理员id 
    commoditys: [{
        type: mongoose.Schema.Types.ObjectId,
        ref: commodityModel
    }], //门店下商品集合
    isFlag: Number, // 门店是否可用
    services: [{
        type: mongoose.Schema.Types.ObjectId,
        ref: serviceModel
    }]
})

module.exports = mongoose.model("shopDoorModel", shopDoorsSchma, "shopDoors")